using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using Yoozoo.UI;

public class RawImageBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<RawImageBinder.AttributeType, int> AttributeValueDic =
        new Dictionary<RawImageBinder.AttributeType, int>
        {
            {RawImageBinder.AttributeType.textureName, 5},
            {RawImageBinder.AttributeType.uvRect, 10},
            {RawImageBinder.AttributeType.onCullStateChanged, 101},
            {RawImageBinder.AttributeType.maskable, 3},
            {RawImageBinder.AttributeType.isMaskingGraphic, 3},
            {RawImageBinder.AttributeType.color, 7},
            {RawImageBinder.AttributeType.raycastTarget, 3},
            {RawImageBinder.AttributeType.enabled, 3},
        };

    public RawImageBinderTreeItem() : base(typeof(RawImage))
    {
    }

    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (RawImageBinder.AttributeType binderType in Enum.GetValues(typeof(RawImageBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(),
                binderType.ToString(), AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}